package com.talking.presenter;

import com.talking.model.Http;

import java.io.File;

import okhttp3.Callback;

public class GroupPresenter {
    public static void create(String groupName, String account, File file, Callback callback){
        Http.upload("group/create/?groupName="+groupName+"&account="+account,file,callback);
    }

    public static void queryUser(String account,Callback callback) {
        Http.get("group/queryUser/?account="+account,callback);
    }
    public static void queryGroupById(String id,Callback callback) {
        Http.get("group/queryGroupById/?id="+id,callback);
    }
    public static void updateNameById(String id,String name,Callback callback){
        Http.get("group/updateNameById/?id="+id+"&name="+name,callback);
    }
    public static void updateIconById(String id,File file,Callback callback){
        Http.upload("group/updateIconById/?id="+id,file,callback);
    }
    public static void enterGroup(String account,String groupId,Callback callback){
        Http.get("group/enterGroup/?account="+account+"&groupId="+groupId,callback);
    }
    public static void queryAllMember(String groupId,Callback callback){
        Http.get("group/queryAllMember/?groupId="+groupId,callback);
    }
    public static void exitGroup(String account,String groupId,Callback callback) {
        Http.get("group/exit/?account="+account+"&groupId="+groupId,callback);
    }
}